Caption = "Form Wizard - Data Control Specifications"
ClientHeight = 3075
ClientLeft = 3225
ClientTop = 1635
ClientWidth = 6090
ControlBox = 0 'False
Height = 3480
HelpContextID = 18
Icon = DATASPEC.FRX:0000
Left = 3165
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 3075
ScaleWidth = 6090
Top = 1290
Width = 6210
Begin SSCommand BtnHelp
Caption = "&Help"
Font3D = 2 'Raised w/heavy shading
Height = 615
Left = 4320
Picture = DATASPEC.FRX:0302
TabIndex = 14
Top = 1980
Width = 915
End
Begin CommonDialog CMDialog1
DialogTitle = "Select Database For Data Control"
Filter = "Access Databases|*.mdb"
Left = 120
Top = 2100
End
Begin ComboBox LstRecSrce
BackColor = &H00C0C0C0&
Height = 300
Left = 1560
Sorted = -1 'True
Style = 2 'Dropdown List
TabIndex = 4
Tag = "Select or enter record source for the data control"
Top = 1560
Width = 4395
End
Begin SSCommand BtnFindDB
AutoSize = 2 'Adjust Button Size To Picture
Font3D = 2 'Raised w/heavy shading
Height = 600
Left = 5340
Picture = DATASPEC.FRX:0604
TabIndex = 3
Tag = "Press to find the database"
Top = 840
Width = 600
End
Begin TextBox TxtDBName
BackColor = &H00C0C0C0&
Height = 375
Left = 1560
TabIndex = 2
Tag = "Name of the database for the data control"
Text = "Database Name"
Top = 1080
Width = 3675
End
Begin TextBox TxtName
BackColor = &H00C0C0C0&
Height = 375
Left = 1560
TabIndex = 0
Tag = "Name for the data control"
Text = "DataName"
Top = 120
Width = 3675
End
Begin TextBox TxtCaption
BackColor = &H00C0C0C0&
Height = 375
Left = 1560
TabIndex = 1
Tag = "Caption for the data control"
Text = "Data Caption"
Top = 600
Width = 3675
End
Begin SSCommand BtnPrev
AutoSize = 2 'Adjust Button Size To Picture
Caption = "&Previous"
Font3D = 2 'Raised w/heavy shading
Height = 615
Left = 720
Picture = DATASPEC.FRX:0906
TabIndex = 5
Tag = "Return to previous step"
Top = 1980
Width = 915
End
Begin SSCommand BtnNext
AutoSize = 2 'Adjust Button Size To Picture
Caption = "&Next"
Font3D = 2 'Raised w/heavy shading
Height = 615
Left = 1620
Picture = DATASPEC.FRX:0C08
TabIndex = 6
Tag = "Proceed to the next step"
Top = 1980
Width = 915
End
Begin SSCommand BtnCancel
AutoSize = 2 'Adjust Button Size To Picture
Caption = "&Cancel"
Font3D = 2 'Raised w/heavy shading
Height = 615
Left = 2520
Picture = DATASPEC.FRX:0F0A
TabIndex = 7
Tag = "Cancel building the form"
Top = 1980
Width = 915
End
Begin SSCommand BtnFinish
AutoSize = 2 'Adjust Button Size To Picture
Caption = "&Finish"
Enabled = 0 'False
Font3D = 2 'Raised w/heavy shading
Height = 615
Left = 3420
Picture = DATASPEC.FRX:120C
TabIndex = 8
Top = 1980
Width = 915
End
Begin SSPanel cMsg
Align = 2 'Align Bottom
Alignment = 1 'Left Justify - MIDDLE
BevelInner = 1 'Inset
BorderWidth = 2
Height = 375
Left = 0
TabIndex = 9
Top = 2700
Width = 6090
End
Begin Label Label1
Alignment = 1 'Right Justify
AutoSize = -1 'True
BackColor = &H00C0C0C0&
Caption = "Record Source"
ForeColor = &H00FF0000&
Height = 195
Index = 3
Left = 195
TabIndex = 13
Top = 1620
Width = 1290
End
Begin Label Label1
Alignment = 1 'Right Justify
AutoSize = -1 'True
BackColor = &H00C0C0C0&
Caption = "Database Name"
ForeColor = &H00FF0000&
Height = 195
Index = 2
Left = 120
TabIndex = 12
Top = 1200
Width = 1365
End
Begin Label Label1
Alignment = 1 'Right Justify
AutoSize = -1 'True
BackColor = &H00C0C0C0&
Caption = "Name"
ForeColor = &H00FF0000&
Height = 195
Index = 1
Left = 960
TabIndex = 11
Top = 180
Width = 495
End
Begin Label Label1
Alignment = 1 'Right Justify
AutoSize = -1 'True
BackColor = &H00C0C0C0&
Caption = "Caption"
ForeColor = &H00FF0000&
Height = 195
Index = 0
Left = 780
TabIndex = 10
Top = 660
Width = 660
End
End
Option Explicit
Sub BtnCancel_Click ()
EndItNow
End Sub
Sub BtnCancel_GotFocus ()
cMsg.Caption = BtnCancel.Tag
End Sub
Sub BtnCancel_LostFocus ()
cMsg.Caption = ""
End Sub
Sub BtnFindDB_Click ()
CMDialog1.Flags = OFN_FILEMUSTEXIST
CMDialog1.Action = 1
If CMDialog1.Filename <> "" Then
TxtDBName = CMDialog1.Filename
GetTableNames
End If
End Sub
Sub BtnFindDB_GotFocus ()
cMsg.Caption = BtnFindDB.Tag
End Sub
Sub BtnFindDB_LostFocus ()
cMsg.Caption = ""
End Sub
Sub BtnHelp_Click ()
SendKeys "{F1}"
End Sub
Sub BtnNext_Click ()
FieldFrm.Show MODELESS
DataSpec.Hide
End Sub
Sub BtnNext_GotFocus ()
cMsg.Caption = BtnNext.Tag
End Sub
Sub BtnNext_LostFocus ()
cMsg.Caption = ""
End Sub
Sub BtnPrev_Click ()
CaptnFrm.Show MODELESS
DataSpec.Hide
End Sub
Sub BtnPrev_GotFocus ()
cMsg.Caption = BtnPrev.Tag
End Sub
Sub BtnPrev_LostFocus ()
cMsg.Caption = ""
End Sub
Sub FldGotFocus (PControl As Control)
PControl.BackColor = BLUE
PControl.ForeColor = WHITE
PControl.SelStart = 0
PControl.SelLength = 1000
cMsg.Caption = PControl.Tag
End Sub
Sub FldLostFocus (PControl As Control)
PControl.BackColor = RB_GRAY
PControl.ForeColor = BLACK
cMsg.Caption = ""
End Sub
Sub Form_Paint ()
Form3d Me
End Sub
Sub GetTableNames ()
' Get names of tables in selected database
Dim sstables As snapshot, msg As String
On Error GoTo GetTablesErr
mousepointer = HOURGLASS
If TxtDBName.Text = "" Then Exit Sub
On Error GoTo OpenDBErr
If Dir$(TxtDBName.Text) = "" Then
Beep
MsgBox "The database name you have specified does not exist! Use the file drawer button to locate a database.", 0 + 48 + 0 + 0, "Database Selection Error"
TxtDBName.SetFocus
mousepointer = DEFAULT
Exit Sub
End If
LstRecSrce.Clear
Set db = OpenDatabase(TxtDBName.Text)
On Error GoTo GetTablesErr
Set sstables = db.ListTables()
Do While Not sstables.EOF
If sstables!Attributes And DB_SYSTEMOBJECT Then
Else
LstRecSrce.AddItem sstables!Name
End If
sstables.MoveNext
Loop
sstables.Close
LstRecSrce.ListIndex = 0
mousepointer = DEFAULT
Exit Sub
OpenDBErr:
Beep
mousepointer = DEFAULT
msg = "A " & Error & " error has occurred opening the database! Please correct and retry the function"